<!DOCTYPE html>
<html lang="en">

<!--
  Author：蓝田_Loto
  Date：2018-10-16 10:27
  PageName：d_practice4_Centered.html
  Function：实战案例 - 网页居中显示
  URL：http://localhost:8080/e3_webpage_CSS3_TextStyle/d_practice4_Centered.html
-->

<head>
    <meta charset="UTF-8">
    <title>实战案例 - 网页居中显示</title>

    <style type="text/css">
        /* 定义网页在IE下对齐 */
        body {
            text-align: center;
        }

        div {
            margin-left: auto;
            margin-right: auto;
            border: solid 1px red;
            width: 60%;
        }
    </style>
</head>

<body>
<div><img src="images/1.png"/></div>
</body>
</html>